package com.caozhi.mspeoject.nb_search.repository;

import com.woniuxy.boot.common.bean.EsOrder;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface OrderSearchRepository extends ElasticsearchRepository<EsOrder, Long> {
//    @Query("""
//    {
//      "bool": {
//        "must": [
//          {"match": {"no": ?0}},
//          {"match": {"name": ?1}},
//          {"match": {"phone": ?2}},
//          {"match": {"frameNumber": ?3}},
//          {"match": {"carNumber": ?4}}
//        ],
//        "minimum_should_match": 1
//      }
//    }
//    """)
    List<EsOrder> findByNoOrNameOrPhoneOrFrameNumberOrCarNumber(String no , String name , String phone , String frameNumber , String carNumber );
    void  deleteAll();
}
